/* 
   Hex-Reinforced Design System
   Components
*/

/* --- PANELS --- */
.glass-panel {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px) saturate(180%);
    border: 1px solid var(--border-color);
}

.glass-panel-heavy {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border-color);
}

/* --- COMMAND BAR --- */
.command-bar {
    height: 64px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* --- SEARCH BAR --- */
.omni-search {
    width: 400px;
    padding: 10px 24px;
    background: rgba(59, 130, 246, 0.3);
    /* Acts as visible border */
    border: none;
    color: white;
    font-family: var(--font-mono);
    font-size: 13px;
    position: relative;
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%,
            calc(100% - 15px) 100%, 15px 100%, 0 50%);
}

/* Inner background (creates border effect) - NOTE: Pseudo-elements don't work on input tags in some browsers, 
   so we might need a wrapper if strict border is needed. For now, using simple background. 
   Better approach for inputs: wrap in a div or use background-image tricks. 
   The spec suggests pseudo-elements but that requires a wrapper for inputs. 
   Let's assume the input itself has the background for now or use a wrapper in HTML.
*/
.omni-search::placeholder {
    color: var(--text-muted);
}

.omni-search:focus {
    background: var(--hex-blue);
    /* Brighter border on focus */
    outline: none;
}

/* --- BUTTONS --- */
.btn-hex {
    height: 40px;
    padding: 0 32px;
    background: rgba(59, 130, 246, 0.25);
    border: none;
    color: var(--hex-blue);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%,
            calc(100% - 15px) 100%, 15px 100%, 0 50%);
    filter: drop-shadow(0 0 1px var(--hex-blue));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-hex:hover {
    background: var(--hex-blue);
    color: white;
}

.btn-hex-secondary {
    height: 40px;
    padding: 0 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%,
            calc(100% - 15px) 100%, 15px 100%, 0 50%);
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-hex-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* --- HEX ICONS --- */
.hex-icon-frame {
    width: 30px;
    height: 26px;
    background: rgba(59, 130, 246, 0.1);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--hex-blue);
}

/* --- ANGLED PANELS (Cards) --- */
.angled-panel {
    position: relative;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    /* Fallback */
    clip-path: polygon(20px 0, 100% 0,
            100% calc(100% - 20px), calc(100% - 20px) 100%,
            0 100%, 0 20px);
    padding: 24px;
}

/* --- INPUT GROUPS --- */
.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: none;
    padding: 6px 16px;
    position: relative;
    transition: all 0.2s;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%,
            calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.input-group:focus-within {
    background: var(--hex-blue);
}

/* --- H3 HEXAGON GRID HELPERS --- */
.hex-row {
    display: flex;
    margin-top: -30px;
    /* Vertical overlap for tight packing */
    justify-content: center;
}

.hex-row:nth-child(even) {
    margin-left: 68px;
    /* Offset even rows by half hex width */
}

.hex-cell-wrapper {
    width: 136px;
    height: 118px;
    margin: 0 2px;
    justify-content: center;
    align-items: center;
}

/* --- HEX TOGGLES --- */
.hex-toggles {
    display: flex;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.hex-toggle {
    padding: 6px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.hex-toggle:hover {
    color: var(--text-main);
}

.hex-toggle.active {
    color: white;
    background: var(--hex-blue);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* --- TOAST NOTIFICATIONS --- */
.hex-toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.hex-toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    backdrop-filter: blur(12px);
    animation: hex-toast-in 0.3s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.hex-toast.removing {
    opacity: 0;
    transform: translateX(40px);
}

.hex-toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.hex-toast-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.hex-toast-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.hex-toast-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.hex-toast-icon { flex-shrink: 0; font-size: 14px; }
.hex-toast-body { flex: 1; }
.hex-toast-title { font-weight: 600; margin-bottom: 2px; }
.hex-toast-msg { opacity: 0.85; }

.hex-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
}
.hex-toast-close:hover { opacity: 1; }

@keyframes hex-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}